﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 战棋模拟器
{
    class 恐狼前锋:Minion
    {
        public Minion left = new Minion(), right = new Minion();//左右受到光环的随从
        public 恐狼前锋():base()
        {
            buff = 1;
            Attack = 2;
            Health = 2;
            Race = race.beast;
        }


        public override void Initialize()
        {
            if (Place > 0)
            {
                left = pool.places[Place - 1];
                left.Attack+=buff;
            }
            if (Place < pool.minionCount - 1)
            {
                right = pool.places[Place + 1];
                right.Attack+=buff;
            }
            base.Initialize();
        }


        public override void OnDie(Minion m)
        {
            if(m==left)
                if (Place > 0)
                {
                    left = pool.places[Place - 1];
                    left.Attack+=buff;
                }
            if(m==right)
                if (Place < pool.minionCount - 1)
                {
                    right = pool.places[Place + 1];
                    right.Attack+=buff;
                }
        }


        public override void OnSpawn(Minion m)
        {
            if(m.Place == Place-1)
            {
                left.Attack-=buff;
                left = m;
                left.Attack+=buff;
            }
            if(m.Place==Place+1)
            {
                right.Attack-=buff;
                right = m;
                right.Attack+=buff;
            }
        }


        public override void Die()
        {
            left.Attack -= buff;
            right.Attack -= buff;
            base.Die();
        }


        public override Minion NewOne()
        {
            return new 恐狼前锋();
        }
    }


    class 恐狼前锋_金色 : 恐狼前锋
    {
        public 恐狼前锋_金色() : base()
        {
            Attack *= 2;
            Health *= 2;
            count *= 2;
            buff *= 2;
        }

        public override Minion NewOne()
        {
            return new 恐狼前锋_金色();
        }
    }
}
